package com.esri.core.tasks.na;

import com.esri.core.internal.util.d;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class NAMessage {
    private String description;
    private int type;

    public NAMessage() {
        this.description = null;
    }

    public NAMessage(int i, String str) {
        this.description = null;
        this.type = i;
        this.description = str;
    }

    public int getType() {
        return this.type;
    }

    public String getDescription() {
        return this.description;
    }

    public static NAMessage fromJson(JsonParser jsonParser) throws Exception {
        if (d.c(jsonParser)) {
            NAMessage nAMessage = new NAMessage();
            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                String currentName = jsonParser.getCurrentName();
                jsonParser.nextToken();
                if ("type".equals(currentName)) {
                    nAMessage.type = jsonParser.getIntValue();
                } else if ("description".equals(currentName)) {
                    nAMessage.description = jsonParser.getText();
                } else {
                    jsonParser.skipChildren();
                }
            }
            return nAMessage;
        }
        return null;
    }

    public int hashCode() {
        String str = this.description;
        return (((str == null ? 0 : str.hashCode()) + 31) * 31) + this.type;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            NAMessage nAMessage = (NAMessage) obj;
            String str = this.description;
            if (str == null) {
                if (nAMessage.description != null) {
                    return false;
                }
            } else if (!str.equals(nAMessage.description)) {
                return false;
            }
            return this.type == nAMessage.type;
        }
        return false;
    }

    public String toString() {
        return "NAMessage [type=" + this.type + ", description=" + this.description + "]";
    }
}
